<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="../../layout/base/base.css">
    <link rel="stylesheet" href="com-radio.css">
    <script src="../../lib/jquery.js"></script>
    <script src="com-radio.js"></script>
</head>
<style>
    .demo{
        width:800px;
        min-height: 400px;
        margin:0 auto;
        padding:10px;
        border: 1px solid #ebebeb;
    }
</style>
<body>

<div class="feat-grid feat-reset demo clearfix">

    <section data-name="comRadio" id="radio-1" class="com-radio">
        <label class="box-add">
            <input name="radio-1" type="radio" checked="checked" value="小明">
            <i data-name="radioBox" class="radio-box"></i>
            <span>小明</span>
        </label>

        <label class="ml10">
            <input name="radio-1" type="radio" value="小红">
            <i data-name="radioBox" class="radio-box"></i>
            <span>小红</span>
        </label>
    </section>

    <section data-name="comRadio" id="radio-1" class="com-radio">
        <label class="box-add">
            <input name="radio-1" type="radio" checked="checked" value="小明">
            <i data-name="radioBox" class="radio-box"></i>
            <span>小明</span>
        </label>

        <label class="ml10">
            <input name="radio-1" type="radio" value="小红">
            <i data-name="radioBox" class="radio-box"></i>
            <span>小红</span>
        </label>
    </section>

    <input type="button" id="get" value="点击我" class="mt20">

</div>

<script>

    var radioObj = $('.com-radio');
    radioObj.comRadio({
        clickHandler:function(clickObj){
            console.log(clickObj[0]);
            console.log(clickObj.prop('checked'))
        }
    });

    $("#get").click(function(){
        console.log(radioObj)
    })


</script>
</body>
</html>